<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function foo() {
			var data = 1;
			return function () {
				console.log(data);
			}
		}
		var f1 = foo();
		var f2 = foo();
		f1();
		f2();

    </script>
</head>
<body>

</body>
</html>